<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>


<rapid:override name="title">
    <title>文章分类</title>
</rapid:override>

<rapid:override name="breadcrumb">
    <%--面包屑导航 start--%>
    <nav class="breadcrumb">
        <a class="crumbs" href="/">
            <i class="fa fa-home"></i>首页</a>
            <i class="fa fa-angle-right"></i>
        ${category.categoryName}
    </nav>
    <%--面包屑导航 end--%>
</rapid:override>

<rapid:override name="left">
    <%--博客主体 start--%>
        <div id="primary" class="content-area">
        <%--博客主体-左侧正文 start--%>
            <main id="main" class="site-main">
                <c:choose>
                    <c:when test="${pageInfo.total>0}">
                        <%--文章列表-start--%>
                        <c:forEach items="${pageInfo.list}" var="p">
                            <article class="post type-post">
                                <header class="entry-header">
                                    <h2 class="entry-title">
                                        <a href="/post/${p.postId}"
                                           rel="bookmark">
                                                ${p.title}
                                        </a>
                                    </h2>
                                </header>

                                <div class="entry-content">
                                    <div class="archive-content" style="margin-bottom:50px">
                                        ${p.postSummary}
                                    </div>
                                    <span class="title-l"></span>
                                    <span class="new-icon">
                                                <jsp:useBean id="nowDate" class="java.util.Date"/>
                                                <c:set var="interval"
                                                       value="${nowDate.time - p.updateTime.time}"/><%--时间差毫秒数--%>
                                                <fmt:formatNumber value="${interval/1000/60/60/24}" pattern="#0"
                                                                  var="days"/>
                                                <c:if test="${days <= 7}">NEW</c:if>
                                    </span>
                                    <span class="entry-meta">
                                        <span class="date">
                                            <fmt:formatDate value="${p.updateTime}" pattern="yyyy年MM月dd日"/>
                                        &nbsp;&nbsp;
                                        </span>
                                        <span class="comment">&nbsp;&nbsp;
                                            <div style="display: inline-block;">
                                              <i class="fa fa-comment-o"></i>
                                                <c:choose>
                                                    <c:when test="${p.commentCount<1}">
                                                        发表评论
                                                    </c:when>
                                                    <c:otherwise>
                                                        ${p.commentCount}
                                                    </c:otherwise>
                                                </c:choose>
                                            </div>
                                        </span>
                                    </span>
                                    <div class="clear"></div>
                                </div><!-- .entry-content -->
                            </article>
                        </c:forEach>
                        <%--文章列表-end--%>
                    </c:when>
                </c:choose>
            </main>
            <%@ include file="../Public/part/paging.jsp" %>
        </div>
</rapid:override>



<%@ include file="../Public/framework.jsp" %>